import Vue from 'vue'
import dataV from '@jiaminghi/data-view'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n
import 'amfe-flexible/index'

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control

import Vant from 'vant'
import 'vant/lib/index.css'

//引入 jq 和 ztree
require('../static/plugins/ztree/css/zTreeStyle/zTreeStyle.css')
require('../static/plugins/ztree/css/bootstrapStyle/bootstrapStyle.css')
// import  "../static/plugins/jquery/jquery-3.2.1.min.js";
import $ from 'jquery'
import '../static/plugins/ztree/js/jquery.ztree.core.min.js'
import '../static/plugins/ztree/js/jquery.ztree.excheck.min.js'
import '../static/plugins/ztree/js/jquery.ztree.exedit.min.js'
/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
// if (process.env.NODE_ENV === 'production') {
//   const { mockXHR } = require('../mock')
//   mockXHR()
// }

//引入 编辑器

import VueQuillEditor from 'vue-quill-editor'

import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import * as moment from 'moment'
import searchui from './views/search/search.vue'
import searchUiNew from './views/searchNew/searchNew.vue'
import tableTemplate from './views/table/tableTemplate.vue'
Vue.prototype.$moment = moment
Vue.use(VueQuillEditor)
// set ElementUI lang to EN
Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
// Vue.use(ElementUI)
Vue.use(Vant)
Vue.use(dataV)
Vue.component('searchui', searchui)
Vue.component('searchuinew', searchUiNew)
Vue.component('tableTemplate', tableTemplate)
//抽屉组件默认 点击遮罩层不关闭
// ElementUI.Drawer.props.wrapperClosable.default = false

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: (h) => h(App),
  beforeCreate() {
    // 注册全局事件总线$bus
    Vue.prototype.$bus = this
  },
})
